import request from '@/utils/request'

const act_dsn_form_layoutApi = {
  viewLayoutByStepId: '/act_dsn_form_layout/viewByStepId',
  viewByProcessStepId: '/act_dsn_form_layout/viewByProcessStepId',
  listByFormid: '/act_dsn_form_layout/listByFormid',
  save: '/act_dsn_form_layout/save',
  saveDraftOrAll: '/act_dsn_form_layout/saveDraftOrAll'
}

export function listByFormid (params) {
  return request({
    url: act_dsn_form_layoutApi.listByFormid,
    method: 'post',
    params: params
  })
}
// 根据流程环节id查看流程表单布局设计
export function viewByProcessStepId (params) {
  return request({
    url: act_dsn_form_layoutApi.viewByProcessStepId,
    method: 'post',
    params: params
  })
}
// 根据表单环节id查看流程表单布局设计
export function viewLayoutByStepId (params) {
  return request({
    url: act_dsn_form_layoutApi.viewLayoutByStepId,
    method: 'post',
    params: params
  })
}

export function saveLayout (data) {
  return request({
    url: act_dsn_form_layoutApi.save,
    method: 'post',
    data: data
  })
}

/**
 *
 * @param {*} data layout
 * @param {*} param formedit: 3200/3201
 * @returns
 */
export function saveDraftOrAll (data, param) {
  return request({
    url: act_dsn_form_layoutApi.saveDraftOrAll,
    method: 'post',
    data: data,
    params: param
  })
}
